<template>
  <div>
<!--    <el-select v-model="uuid" placeholder="Select" style="width: 240px">-->
<!--      <el-option v-for="item in uuIdList.data" :key="item.uuId" :label="item.createTime" :value="item.uuId"/>-->
<!--    </el-select>-->
  </div>
  <el-table :data="tableData.data" stripe style="width: 100%">
    <el-table-column prop="idCode" label="证件号" width="180" />
    <el-table-column prop="msg" label="错误信息" width="180" />
    <el-table-column prop="uuId" label="uuId" />
<!--    <el-table-column prop="userId" label="userId" />-->
<!--    <el-table-column prop="exhibitionId" label="exhibitionId" />-->
    <el-table-column prop="createTime" label="createTime" />
  </el-table>
  <el-pagination background layout="prev, pager, next" :page-size="15" :total="pageTotal" @current-change="currentChange"/>
</template>

<script setup>
import { ref,reactive } from "vue";
import {_getUUidList, _importErrorList} from "../../http/api.js";


const loginId = sessionStorage.getItem('loginId');
const uuid = ref('');// 选择的uuid
const uuIdList = reactive({ // 用户id列表
  data:[]
})
const tableData = reactive({
  data:[]
})
const pageTotal = ref(0); // 总数
let pageIndex = ref(1);
//获取uuid列表
const getUUIDList = () => {
  _getUUidList()
      .then(res => {
        console.log(res);
        if(res.data.ok) {
          uuIdList.data = res.data.data||[];
        }
      })
      .catch(err => {
        console.log(err);
      })
}
getUUIDList()
// 获取错误列表
const importErrorList = () => {
  let params = {
    current:pageIndex.value,
    size: 15,
    userId:loginId
  }
  _importErrorList(params)
      .then(res => {
        console.log(res);
        if(res.data.ok) {
          let item = res.data.data;
          pageTotal.value = item.total;
          tableData.data = item.records;
        }
      })
      .catch(err => {
        console.log(err);
      })
}
importErrorList()
// 分页点击
const currentChange = (index) => {
  pageIndex.value = index;
  importErrorList()
}
</script>

<style scoped lang="scss">

</style>